<?php 

class LoginController extends Controller{
	public function __init()
	{
		# code...
	}
	//用户登录
	public function login()
	{
		if (IS_POST) {
			$db=K('Login');
			if ($db->userLogin()) {
				$this->success('登录成功',U('Index/index'));
			}else{
				$this->error($db->error);
			}
		}else{
			$this->display();
		}
	}
	//验证码
	public function code()
	{
		$obj=new Code;
		$obj->show();
	}
}


 ?>